/*
  *	include/cos/ipc.h
  *
  *	created at 2007.10.01 by ChenJie
  *
  *	last modified at 2007.10.01
  *	
  */
  #ifndef IPC_H
  #define IPC_H

  #include <clinux/sched.h>

#define ANY_PROC	-1
#define ALL_PROC	-2

  struct msg_struct {
	unsigned long		source;		// pid of the msg  come from
	unsigned long		type;		// what kinds of msg
	unsigned long		time;		// ...
	unsigned long		context[6];	// message body
  };

  struct msgbox_struct {
  	struct proc_struct *	waiting_for_sending; 	//the sleeping process  has been ready for receiving msg.
	struct proc_struct *	waiting_for_receiving;	//the sleeping process has been ready for sending msg.
	struct proc_struct *	waiting_for_any_arrive;  //the sleeping process has been ready for receiveing any msg.
	struct msg_struct	sendbox;
	struct msg_struct	receivebox;
	unsigned long	notify_pending;
	unsigned long	notify_context[32];
  };

  #endif
